package com.woniuxy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniuxy.dao.WorkMapper;
import com.woniuxy.pojo.Work;
import com.woniuxy.service.WorkService;
@Service
@Transactional
public class WorkServiceImpl implements WorkService {
	@Autowired
	private WorkMapper workMapper;

	@Override
	public List<Work> getAll(Integer id) {
		// TODO Auto-generated method stub
		return workMapper.getAllWork(id);
	}

	@Override
	public void addWork(Work work) {
		// TODO Auto-generated method stub
		workMapper.addWork(work);
	}

	@Override
	public void delWork(Integer id) {
		// TODO Auto-generated method stub
		workMapper.delWork(id);
	}

	@Override
	public void updateWork(Work work) {
		// TODO Auto-generated method stub
		workMapper.updateWork(work);
	}

	@Override
	public List<Work> findByCom(String company) {
		// TODO Auto-generated method stub
		return workMapper.findWorkByCom(company);
	}

	@Override
	public int deleteManyByIds(String ids) {
		// TODO Auto-generated method stub
		return workMapper.deleteManyByIds(ids);
	}

	@Override
	public Work getWorkByCid(Integer cid) {
		// TODO Auto-generated method stub
		return workMapper.selectOneByCid(cid);
	}

	@Override
	public void saveUpdate(Work work) {
		// TODO Auto-generated method stub
		workMapper.updateWork(work);
	}


}
